<template>
  <ul class="approvalGroup_list" v-if="records && records.length > 0">
    <approval-item
      :isCanDelete="isCanDelete"
      v-on:delSuccess="delSuccess"
      :recordIndex="index"
      :record="item"
      v-for="(item, index) in records"
      :key="'recoredItem' + index"
    />
  </ul>
  <Empty description="暂无审批流程~" v-else />
</template>

<script>
  import ApprovalItem from './ApprovalItem'
  import { Empty } from 'ant-design-vue'
  export default {
    name: 'ApprovalGroup',
    props: {
      records: Array,
      isCanDelete: ''
    },
    components: {
      Empty,
      ApprovalItem
    },
    methods: {
      delSuccess(index) {
        this.records.splice(index, 1)
      }
    }
  }
</script>

<style lang="stylus" scoped>
  .approvalGroup_list {
      list-style none
      padding 0px;
      margin 0px;
      -webkit-transition: all .5s ease;
      transition: all .5s ease;
  }
</style>
